//
//  KDActivityView.m
// 
//
//  Created by  zhaojw on 09-12-6.
//  Copyright 2009 CocoaChina.com. All rights reserved.
//

#import "KDActivityView.h"
 #import <QuartzCore/QuartzCore.h>

@implementation KDActivityView

- (id)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {

		self.autoresizesSubviews = YES;
		[self setBackgroundColor:[UIColor blackColor]];
		self.layer.cornerRadius = 10;
		
		UIActivityIndicatorView *activityView;
		activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
		activityView.frame = CGRectMake(80, 20, 37.0f, 37.0f);
		[self addSubview:activityView];
		[activityView release];	
		[activityView startAnimating];
		
		UILabel *titleLable;		
		CGRect nameLabelRect = CGRectMake(35, 60, 130, 25);
		titleLable = [[UILabel alloc] initWithFrame:nameLabelRect];
		titleLable.textAlignment = UITextAlignmentCenter;
		titleLable.text=@"Loading...";
		titleLable.font = [UIFont boldSystemFontOfSize:18];
		titleLable.alpha =1.0;
		titleLable.backgroundColor = [UIColor clearColor];
		titleLable.textColor = [UIColor whiteColor];		
		[self addSubview:titleLable];
		[titleLable release];		
    }
    return self;
}


- (void)dealloc {
    [super dealloc];
}


@end
